package com.morphiastic.tests.leandro;

import org.bson.types.ObjectId;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.morphiastic.annotations.*;
import com.morphiastic.analysis.analyzers.CustomAnalyzer;
import com.morphiastic.analysis.analyzers.ElasticAnalyzerType;
import com.morphiastic.analysis.analyzers.SnowballAnalyzer;
import com.morphiastic.analysis.filters.*;
	
	
@ElastiMorphed(typeName = "local")
@Entity("local")
@FilterDefinitions({
       @FilterDefinition(defName="localPhoneticFilter", type=ElasticFilterType.phonetic, 
                       parameters={
                               @Parameter(key=PhoneticTokenFilter.ENCODER_PARAM_KEY, value=PhoneticTokenFilter.metaphone),
                               @Parameter(key=PhoneticTokenFilter.REPLACE_PARAM_KEY, value="false")
                       } 
       )
})
public class LocalEntity {
       @Id
       private ObjectId        id;

       @ElastiField(boost = @Boost(value = 2.0F))
       private String name;

       @ElastiField(
           analyzer=@Analyzer(
                   defName="localPropAnalizer", 
                   type=ElasticAnalyzerType.snowball , 
                   parameters ={
                           @Parameter(key=SnowballAnalyzer.LANGUAGE_PARAM_KEY, value="Portuguese")
                   }
           ),
           boost=@Boost(value=2.0f)
   )
       private String                endereco;

}